#include<bits/stdc++.h>
using namespace std;

vector<int> days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int ans = 0, week = 1;

void solution1() {
    for(int y = 1901; y <= 2000; y++) {

        if((y % 4 == 0 && y % 100) || (y % 400)) days[2] = 29;
        else days[2] = 28;

        for(int i = 1; i <= 12; i++) {
            for(int j = 1; j <= days[i]; j++) {
                if(j == 1 && !week) ans++;
                week = (week + 1) % 7;
            }
        }
    }
}


void solution2() {
    for(int y = 1901; y <= 2000; y++) {

        if((y % 4 == 0 && y % 100) || (y % 400)) days[2] = 29;
        else days[2] = 28;

        for(int m = 1; m <= 12; m++) {
            if(!week) ans++;

            week = (week + days[m]) % 7;
        }
    }
}


signed main() {
//	system("start https://www.lanqiao.cn/problems/16955/learning/");

    solution2();

    cout << ans;

    return 0;
}

